'''
获取命令的执行结果
偶尔去调用系统命令   
'''

# -------------获取命令的执行结果------------------
# import os
# result = os.popen("ping 10.11.0.254")
# print(result)
# print(result.read())
# print(type(result.read()))

# -------------获取命令的执行状态码------------------
import subprocess
result = subprocess.call("ping 10.11.0.254", stdout=subprocess.PIPE, stderr=subprocess.PIPE )
print("结果：", result)














